// 利用 const 关键词也可以声明一组常量，例如，声明十二生肖的排位
const rat: number = 1;
const cattle: number = 2;
const tiger: number = 3;
const rabbit: number = 4;
const dragon: number = 5;

// 数字枚举
enum ChineseZodiac {
    rat,
    cattle,
    tiger,
    rabbit,
    dragon,
}

// 字符串枚举
enum Person {
    name = 'NAME',
    age = 'AGE',
    love = 'LOVE',
    hobby = 'HOBBY',
}
console.log(Person.name); // NAME
console.log(Person.hobby); // HOBBY